#include <iostream>
#include "thread.hpp"
#include <unistd.h>
#include <vector>

void Print()
{
    while(true)
    {
        sleep(1);
        printf("haha,我是一个封装的thread\n");
    }
}

int main()
{
    std::vector<Thread> threads;
    for(int i=0;i<10;i++)
    {
        threads.push_back(Thread(Print));
    }
    for(auto &t:threads)
    {
        t.Run();
    }
    for(auto &t:threads)
    {
        t.Join();
    }
    
    // Thread th(Print);
    // th.Run();
    // std::cout<<"线程名: "<<th.Name()<<std::endl;
    // std::cout<<"是否启动成功: "<<th.IsRunning()<<std::endl;
    // std::cout<<"启动时间戳: "<<th.Start_TimesTamp()<<std::endl;
    // th.Join();
    return 0;
}